home *** CD-ROM | disk | FTP | other *** search
- MyLib.lib/--Introduction-- MyLib.lib/--Introduction--
-
- GENERAL
- MyLib.lib is my personal link library. It consists of several parts:
- - ANSI/ISO-C compliant functions
- - "not quite, but somewhat" ANSI/ISO-C compliant functions
- - Amiga specific functions
- - MUI support
-
- The primary goal of MyLib.lib is not ANSI/ISO compliance; instead
- it is targeted at writing Amiga programs.
-
- MyLib.lib requires AmigaOS 2.04 (V37) or newer; this is ensured by
- the startup code (specifically, it makes sure you have dos.library V37
- and utility.library V37. Usually this means you're running at least
- AmigaOS 2.04).
-
- MyLib.lib enables you to write programs that can be compiled with
- any compiler. Currently supported compilers are SAS/C 5.10b and
- GNU-C (currently 2.6.3).
-
- AMIGA SUPPORT
- __asm is available. See the AsmStub program documentation.
- __interrupt is available. See the AsmStrub program documentation.
- __saveds is only available in conjunction with __asm or __interrupt.
- It cannot be used for functions taking parameters on the
- stack (but it can be used for functions taking no parameters).
- See the AsmStub program documentation.
- __aligned is available, see ALIGN().
- __chip is not available.
- __fast will never be available, even if GNU-C supports it. There
- is no need to ever use __fast.
-
- clib/muimaster.h, inline/muimaster.h and proto/muimaster.h are
- provided.
-
- COMPILER SUPPORT
- __aligned is available, see ALIGN().
- inline is provided as INLINE.
- __far is not available since GNU-C doesn't have it.
- attribute((noreturn)) is available, see NORETURN.
-
- COMPILING
- MyLib.lib requires that the following preprocessor symbols are
- defined during compilation to match the corresponding compiler
- options:
- SMALL_DATA when compiling baserelative code
- SMALL_CODE when compiling with small code model
-
- Not defining SMALL_CODE when compiling small code is usually
- harmless; not defining SMALL_DATA when compiling baserelative
- will produce garbage. I believe that defining SMALL_DATA
- when not compiling baserelative is safe.
-
- A library is provided for each of the four possible combinations
- of small code and baserelative adressing; the library to be used
- can be found in a directory whose name is constructed following
- these rules:
- - a four letter compiler identifier. Currently implemented are
- SAS5 for SAS/C V5.10b
- GNUC for GNU-C (2.6.3)
- - a 'b' if baserelative adressing is to be used
- - a 's' if small code is to be used
- Example: the small-code, not baserelative library for GNU-C is
- called GNUCs/libMyLib.a.
-
- GNU-C
- For GNU-C, you might want to add -DSMALL_DATA and -DSMALL_CODE
- to your specs file to define them automatically for -fbaserel
- and -msmall-code, resp.
-
- The following options are required:
- Preprocessor: -nostdinc -I. -I- -I/gnu/MyLib -I/gnu/os-include
- -I/gnu/include [-DSMALL_CODE] [-DSMALL_DATA]
- Linker: -nostdlib MyLibDirectory/GNUC[b][s]/MyStartup.o
- [your objects] MyLibDirectory/GNUC[b][s]/libMyLib.a
- -lamiga [-fbaserel]
-
- SAS/C V5.10b
- For SAS/C, you must not use stack checking.
-
- The following options are required:
- Compiler: -v -iINCLUDE:MyLib/
- Linker: FROM MyLibDirectory/SAS5[b][s]/MyStartup.o [your objects]
- LIB MyLibDirectory/SAS5[b][s]/MyLib.lib LIB:amiga.lib
- LIB:lc.lib
-
- NOTE
- Depending on your setup, the original header files provided by the
- compiler vendor may still be accessible. Do not use them! MyLib.lib
- is not designed to be compatible to some existing library, or even
- to existing header files. This is contrary to libnix, which uses the
- orginal header files that come with Amiga GNU-C.
-
- Of course, MyLib works with the Commodore Amiga headers.
-
- NOTE
- For SAS/C V5.10b only:
- Currently your programs are linked with lc.lib for SAS/C. This does
- not imply that you are allowed to use functions from lc.lib! You
- must not use such functions; be careful. lc.lib is required for
- integer math functions; I'll hopefully be able to eliminate the
- need for lc.lib at some time.
-
- The proto/alib.h file that came with SAS/C is broken. Replace it
- with a file that only does #include <clib/alib_protos.h>, or
- create a link. That will magically fix "strange" compiler errors.
-